<%-- 
    Document   : editProfile
    Created on : 28/03/2012, 06:41:21 AM
    Author     : John
--%>

<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="riteservices.model.bean.User"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Editar Perfil :: YoTeLlevo.Com</title>
        
     
         <link rel="stylesheet" type="text/css" href="public/css/appStyle.css" />
        <link rel="stylesheet" type="text/css" href="public/css/index_style.css" />
         <link rel="stylesheet" type="text/css" href="public/bootstrap/css/bootstrap-responsive.css" />
         <link rel="stylesheet" type="text/css" href="public/bootstrap/css/bootstrap.css" />
         <link rel="stylesheet" type="text/css" href="public/css/anytimec.css" />
         <link rel="stylesheet" type="text/css" href="public/css/south-street/jquery-ui.css" />
                 
         <script type="text/javascript" src="public/js/jquery.min.js"></script>
         <script type="text/javascript" src="public/js/jquery_ui.js"></script>
         <script type="text/javascript" src="public/js/jquery.validate.js"></script>
         <script type="text/javascript" src="public/js/register.js"></script>
         <script type="text/javascript" src="public/js/anytimec.js"></script>
         <script type="text/javascript" src="public/js/anytimetz.js"></script>
        
    </head>
    <body>
        
        <div class="navbar navbar-top">
                <div class="navbar-inner">
                 <div class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                   
                    </a>
                    <a class="brand" href="#">YoTeLlevo.Com</a>
                    <div class="nav-collapse">
                        <ul class="nav">
                            <li><a href="myRounds.jsp">Mis Rutas</a></li>
                            <li><a href="#">Salir</a></li>
                        </ul>
                    </div><!--/.nav-collapse -->
                 </div>
                </div>
            </div>
        
        <div class="container-fluid">
            <%  User loggedUser  = (User) request.getSession().getAttribute("user"); %>
            <div id="loginFormWrapper" title="Registro de Usuarios">
                <form action="UpdateUser" method="post" class="well span5">
              <table>
                  <tr>
                      <td><label>Nombre: </label></td>
                      <td><input class="span3" name="name" id="name" type="text" value="<% out.print(loggedUser.getName() ); %>"></td>
                  </tr>
                  <tr>
                      <td><label>Apellido: </label></td>
                      <td><input class="span3" name="lastName" id="lastName" type="text" value="<% out.print(loggedUser.getLastName() ); %>" ></td>
                  </tr>
                   <tr>
                      <td><label>Sexo: </label></td>
                      <td><input type="radio" id="male" name="gender" value="male" <% if(loggedUser.getGender().contentEquals("male")) out.println("checked"); %>/> Hombre<input type="radio" id="female" name="gender" value="female" <% if(loggedUser.getGender().compareTo("female")==0) out.println("checked"); %> /> Mujer</td>
                  </tr>
                  <tr>
                      <td><label>Teléfono: </label></td>
                      <td><input class="span3" name="phoneNumber" id="phoneNumber" type="text" value="<% out.print(loggedUser.getPhoneNumber() ); %>" ></td>
                  </tr>
                  <tr>
                      <td><label>Correo: </label></td>
                      <td><input class="span3" name="email" type="text" value="<% out.print(loggedUser.getEmail() ); %>"></td>
                  </tr>
                  <tr>
                      <td><label>Fecha Nacimiento: </label></td>
                      <td><input class="span3" id="birthdate" name="birthdate" type="text" value="<%  
                      SimpleDateFormat formatoDelTexto = new SimpleDateFormat("yyyy-MM-dd"); 
                      out.println(formatoDelTexto.format(loggedUser.getBirthDate()));
                      %>"></td>
                  </tr>
                  <tr>
                      <td><label>Empresa: </label></td>
                      <td><input class="span3" name="company" type="text" value="<% out.print(loggedUser.getCompany() ); %>"></td>
                  </tr>
                  <tr>
                      <td><label>Nombre de Perfil: </label></td>
                      <td><input class="span3" name="profileName" type="text" value="<% out.print(loggedUser.getProfileName() ); %>"></td>
                  </tr>
                  <%
                    if(loggedUser.getFacebookId()==null){
                  %>
                  <tr>
                      <td><label>Contraseña: </label></td>
                      <td><input class="span3" id="password" name="password" type="password" value="<% out.print(loggedUser.getPassword() ); %>"></td>
                  </tr>
                  <tr>
                      <td><label>Confirmar Contraseña: </label></td>
                      <td><input class="span3" name="rpassword" type="password" placeholder="Repita su contraseña..."></td>
                  </tr>
                  <%
                    }
                  %>
                  <tr>
                      <td><label></label></td>
                      <td><input type="submit" id="registerButton" value="Actualizar mis datos"/></td>
                      
                  </tr>
           
              </table>
          </form>
      </div>
          
      </div>
      
      <hr>
      
      <footer>
        <p> <center>&copy; Administración de Proyectos II | 2012 | Equipo Azul | Facultad de Matemáticas</center></p>
      </footer>



            
        
    </body>
</html>
